<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools">

    <data>
        <variable
            name="viewModel"
            type="com.example.messengerapp.viewmodel.ChatViewModel" />
    </data>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".ui.chat.ChatFragment">

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/recyclerViewMessages"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_above="@+id/inputLayout"
            android:layout_alignParentTop="true"
            android:padding="8dp" />

        <LinearLayout
            android:id="@+id/inputLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:orientation="horizontal"
            android:padding="8dp">

            <ImageButton
                android:id="@+id/buttonAttach"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:contentDescription="Attach"
                android:src="@drawable/ic_attach"
                tools:ignore="TouchTargetSizeCheck" />

            <EditText
                android:id="@+id/editTextMessage"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:hint="Текст сообщения"
                android:minHeight="48dp"
                tools:ignore="VisualLintTextFieldSize" />

            <ImageButton
                android:id="@+id/buttonSend"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:contentDescription="Send"
                android:src="@drawable/ic_send"
                tools:ignore="TouchTargetSizeCheck" />
        </LinearLayout>
    </RelativeLayout>
    </layout>